﻿Imports System.Data.OleDb
Public Class ratings
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btn_ChooseRating_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_ChooseRating.Click
        Dim conn As New OleDbConnection(ConfigurationManager.ConnectionStrings("MotorcyclesConn").ConnectionString)

        Dim sql = "INSERT INTO ModificationRatings (Rating,MotorcycleFKID,Rater) VALUES (@f1,@f2,@f3)"

        Dim rateCmd As New OleDbCommand(sql, conn)

        conn.Open()

        rateCmd.Parameters.AddWithValue("@f1", Rating1.CurrentRating)
        rateCmd.Parameters.AddWithValue("@f2", Request.Params("ID"))
        rateCmd.Parameters.AddWithValue("@f3", User.Identity.Name)

        rateCmd.ExecuteNonQuery()

        conn.Close()
        Response.Redirect("confirmation.aspx")
    End Sub
End Class